// FileCtrl.h: interface for the CFileCtrl class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FILECTRL_H__FAAC5EF6_9D1C_4E52_9F3C_5F10457B32A5__INCLUDED_)
#define AFX_FILECTRL_H__FAAC5EF6_9D1C_4E52_9F3C_5F10457B32A5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CFileCtrl  
{
public:
	
	CFileCtrl();	

	virtual ~CFileCtrl();
	
	DWORD GetLength( LPDWORD lpFileSizeHigh );
	
	bool OpenFile( TCHAR * strFilepath );

	HANDLE GetFileHandle();

	DWORD GetFileData( char * buf,
				              DWORD dwStartpos,
				              DWORD dwLength, 
				              LPDWORD dwDataLength,
				              LPDWORD dwErrCode);

	void CloseFile();
	
private:
  
	

	DWORD m_dwLength;

	DWORD m_dwLengthHigh;
	
	HANDLE    hFile;

	HANDLE m_hEventReadFile;


	DWORD dwNumberOfBytesRead ;
	DWORD dwErr;
	BOOL ret;	
    OVERLAPPED overlap ;

};

#endif // !defined(AFX_FILECTRL_H__FAAC5EF6_9D1C_4E52_9F3C_5F10457B32A5__INCLUDED_)
